/*
* @Author: wanghongfucoder
* @Date:   2017-04-12 10:45:45
* @Last Modified by:   wanghongfucoder
* @Last Modified time: 2017-04-12 11:02:29
*/

import java.util.ArrayList;
import java.util.List;

public  class StudentBO {

	List<StudnetVO> students;
	public StudentBO(){
		students=new ArrayList<StudnetVO>();
		StudnetVO student1=new StudnetVO("wang",0);
		StudnetVO student2=new StudnetVO("hongfu",1);
		students.add(student1);
		students.add(student2);
	}	

	public void deleteStudent(StudnetVO student){
		students.remove(student.getRollNo());
		System.out.println("Studnet :   Roll NO "+student.getRollNo()+",deleted from database");
	}


	public List<StudnetVO> getAllStudents(){
		return students;
	}

	public StudnetVO getStudent(int rollNo){
		return students.get(rollNo);
	}

	public void updateStudent(StudnetVO student){
		students.get(student.getRollNo()).setName(student.getName());
		System.out.println("Student Roll No "+student.getRollNo()+",update in the  database");
	}
}